package com.cizzy.video.feign;

import com.cizzy.video.common.Result;
import com.cizzy.video.entity.dao.UserCountDAO;
import com.cizzy.video.entity.dao.UserDAO;
import com.cizzy.video.entity.dto.UserDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author 51755
 */
@FeignClient(name = "user-server-service", fallback = UserFeignFallback.class)
public interface UserFeign {

//    @RequestMapping("/video/upload")
//    public String upload(String fileName, String fileUrl);

//    @RequestMapping(value="/user/id", method = {RequestMethod.GET})
//    Result<UserDAO> getUserById(Long id);

    @GetMapping("/user/id/{id}")
    Result<UserDAO> getUserById(@PathVariable("id") Long id);

    @PostMapping("/user/getUserListByIds")
    Result<List<UserDTO>> getUserListByIds(@RequestBody List<Long> userIdList);


    @GetMapping("/userCount/getUserCountById")
    public Result<UserCountDAO> getUserCountById(@RequestParam("id") Long id);

    @PostMapping("/userCount/getUserCountListByIds")
    public Result<List<UserCountDAO>> getUserCountListByIds(@RequestBody List<Long> ids);

    @GetMapping("/user/getRandomUserIdList/{num}")
    public Result<List<Long>> getRandomUserIdList(@PathVariable("num") Integer num);

//    @RequestMapping(value="/user/getUserCountById", method = {RequestMethod.GET})
//    Result<UserCountDAO> getUserCountById(Long id);

//    @RequestMapping(value="/user/getUserListById", method = {RequestMethod.GET})
//    Result<List<UserDAO>> getUserListById(List<Long> ids);

//    @RequestMapping(value="/userCount/getUserCountListById", method = {RequestMethod.GET})
//    Result<List<UserCountDAO>> getUserCountListById(List<Long> ids);

    @RequestMapping(value="/user/testFeign", method = {RequestMethod.GET})
    void testFeign();
}
